package org.crazyit.album.dao.impl;

import java.util.*;

import org.crazyit.album.domain.*;
import org.crazyit.album.dao.*;
import org.crazyit.album.service.BaseDaoHibernate4;

public class UserDaoHibernate extends BaseDaoHibernate4<User>
        implements UserDao {
    public User findByName(String name) {
        List<User> users = find("select u from User u where u.name = ?0"
                , name);
        if (users != null && users.size() == 1) {
            return users.get(0);
        }
        return null;
    }
}
